﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Framework.Bus;
using Framework.Event;

namespace IHaveBaby
{


    public partial class MSMQTest : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
          
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            var path = string.Format("FormatName:Direct=TCP:{0}", TextBox1.Text.Trim());
            MSMQEventBus eventBus = new MSMQEventBus(null, path);
            eventBus.Post(new ConvertTaskEvent { ID = Guid.NewGuid(), Name = "", CreateTime = DateTime.Now });
            eventBus.Commit();
        }
    }
    
    [Serializable]
    public class ConvertTaskEvent : DomainEvent
    {
        public Guid ID{get;set;}
        public string Name{get;set;}
        public DateTime CreateTime{get;set;}
    }
}